#include <QtGui/QApplication>
#include "appsplash.h"
#include "Settings.h"
#ifdef Q_WS_S60
#include <e32base.h>
#include <eikenv.h>
#include <eikappui.h>
#include <aknenv.h>
#include <aknappui.h>
#include <apgcli.h>
#include <apgtask.h>
#include <eikenv.h>
#endif

QApplication* g_application = NULL;

int setLandscape()
{
#ifdef Q_WS_S60
    CAknAppUi* appUi = dynamic_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi());
    TRAPD(error,
          if(appUi)
    {
        appUi->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape);
    }
          );
    return error;
#else
    return 0;
#endif
}

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    g_application = &a;
    QCMSettings setts;
    QCMSettings::InstallSettings(&setts);
    AppSplash w;
    setLandscape();
#if defined(Q_WS_S60)
    w.showFullScreen();
#elif defined(Q_WS_WIN32)
    w.show();
#else
    w.showMaximized();
#endif

    return a.exec();
}
